package com.colin.springbootsource.event;

/**
 * @author: Colin
 * 2019/12/22 14:05
 * @desc todo
 * @email zhaod@oceansoft.com.cn,colinzhaodong@gmail.com
 */
public class Test {
  public static void main(String[] args) {
      WeatherEventMulticaster weatherEventMulticaster = new WeatherEventMulticaster();
      SnowListener snowListener = new SnowListener();
      RainListener rainListener = new RainListener();
      weatherEventMulticaster.addListener(snowListener);
      weatherEventMulticaster.addListener(rainListener);
      weatherEventMulticaster.multicastEvent(new SnowEvent());
      weatherEventMulticaster.multicastEvent(new RainEvent());
      weatherEventMulticaster.removeListener(rainListener);
      weatherEventMulticaster.multicastEvent(new SnowEvent());
      weatherEventMulticaster.multicastEvent(new RainEvent());
  }
}
